package com.smartEdu.dao.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

import com.smartEdu.commons.ReqMap;
import com.smartEdu.dao.CourseDao;
import com.smartEdu.mapper.CourseDetailMapper;
import com.smartEdu.mapper.CourseInfoMapper;
import com.smartEdu.model.CourseDeatailModel;
import com.smartEdu.model.CourseInstructionModel;
import com.smartEdu.po.CourseInfoPo;

@Repository(value="courseAppDaoImpl")
public class CourseDaoImpl implements CourseDao{
	
	@Autowired(required=false)
	@Qualifier("courseDetailMapper")
	private CourseDetailMapper mapper;
	
	@Autowired(required=false)
	@Qualifier("courseInfoMapper")
	private CourseInfoMapper courseInfoMapper;
	
	@Override
	public List<CourseDeatailModel> getCourseDetail() {
		return mapper.getCourseDetail();
	}

	@Override
	public List<CourseDeatailModel> getCourseDetailByPk(String pk) {
		return mapper.getCourseDetailByPk(pk);
	}

	@Override
	public List<CourseInstructionModel> getCourseInstructionByPk(String pk) {
		return mapper.getCourseInstructionByPk(pk);
	}
	
	@Override
	public List<CourseInfoPo> getCourseListApi(ReqMap map) {
		return courseInfoMapper.getCourseListApi(map.getVals());
	}
	
	@Override
	public List<CourseInfoPo> getClassListApi(ReqMap map) {
		return courseInfoMapper.getClassListApi(map.getVals());
	}

}
